//
//  ZYHTTPRequestSerializer.h
//  ZYWebImage
//
//  Created by wangzhipan on 2025/4/2.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "ZYRequestSerializerProtocl.h"

NS_ASSUME_NONNULL_BEGIN

@interface ZYHTTPRequestSerializer : NSObject <ZYRequestSerializerProtocl>

@property (nonatomic, assign) NSTimeInterval timeoutInterval;
@property (readonly, nonatomic, strong) NSDictionary <NSString *, NSString *> *HTTPRequestHeaders;

+ (instancetype)serializer;

- (void)setValue:(nullable NSString *)value forHTTPHeaderField:(NSString *)field;
- (nullable NSString *)valueForHTTPHeaderField:(NSString *)field;

- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username
                                       password:(NSString *)password;
- (void)clearAuthorizationHeader;

- (nullable NSMutableURLRequest *)requestWithMethod:(NSString *)method
                                          URLString:(NSString *)URLString
                                         parameters:(nullable NSDictionary *)parameters
                                              error:(NSError *__autoreleasing * _Nullable)error;

//小文件
- (nullable NSMutableURLRequest *)uploadWithUrlString:(NSString *)URLString
                                               params:(nullable NSDictionary<NSString *, NSString *> *)params
                                                 name:(NSString *)name
                                             fileName:(NSString *)fileName
                                                 data:(NSData *)data
                                             mimeType:(NSString *)mimeType
                                                error:(NSError *__autoreleasing * _Nullable)error;

//大文件
- (nullable NSMutableURLRequest *)uploadWithUrlString:(NSString *)URLString
                                               params:(nullable NSDictionary<NSString *, NSString *> *)params
                                                 name:(NSString *)name
                                             fileName:(NSString *)fileName
                                              fileUrl:(NSURL *)fileUrl
                                             mimeType:(NSString *)mimeType
                                                error:(NSError *__autoreleasing * _Nullable)error;

@end

NS_ASSUME_NONNULL_END
